package book.nettyinaction.ch05;

import io.netty.buffer.ByteBuf;

import java.util.Random;

/**
 *
 * 代码清单 5-8 写数据
 */
public class Demo008WriteData {

    public static void main(String[] args) {

        Random random = new Random(47);

        // Fills the writable bytes of a buffer with random integers.
        ByteBuf buffer = null;
        while ( buffer.writableBytes() >= 4 ) {
            buffer.writeInt( random.nextInt() );
        }
    }
}
